package dao;

import java.sql.SQLException;
import java.util.Scanner;

public class TestAdd {
    public static void main(String[] args){
        System.out.println("欢迎使用管理系统");
        System.out.println("请输入你要添加的学生姓名：");
        Scanner sc =new Scanner(System.in);
        String name =sc.next();
        System.out.println("请输入你要添加的学生性别：");
        String sex =sc.next();
        System.out.println("请输入你要添加的学生生日：");
        String birthday =sc.next();
        System.out.println("请输入你要添加的学生年龄：");
        int age =sc.nextInt();
        System.out.println("请输入你要添加的学生学号：");
        int deptId = sc.nextInt();

        Emp emp = new Emp(deptId,name,age,sex,birthday);
        EmpDAO dao =new EmpDAO();

            try {
                dao.add(emp);
            } catch (SQLException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }

        System.out.println("执行完毕");
    }
}
